package
{
	import flash.display.DisplayObject;

	public class RendererFactory
	{
		public static const RENDER_TYPE_ND2D:String = 'nd2d';
		public static const RENDER_TYPE_NATIVE:String = 'native';
		
		private var m_renderType:String;
		public function RendererFactory(renderType:String)
		{
			m_renderType = renderType;
		}
		
		public function getWorld():IWorld{
			var world:IWorld;
			
			switch(m_renderType){
				case RENDER_TYPE_ND2D:
					world =  new ND2DWorld();
					break;
				case RENDER_TYPE_NATIVE:
					world =  new NativeWorld();
					break;				
			}
			
			return world;
		}
		
		public function getScene():IScene{
			var scene:IScene;
			
			switch(m_renderType){
				case RENDER_TYPE_ND2D:
					scene = new ND2DScene();
					break;
				case RENDER_TYPE_NATIVE:
					scene = new NativeScene();
					break;				
			}
			
			return scene;
		}
		
		public function getSprite(src:DisplayObject):ISprite{
			var sprite:ISprite;
			
			switch(m_renderType){
				case RENDER_TYPE_ND2D:
					sprite = new ND2DSprite(src);
					break;
				case RENDER_TYPE_NATIVE:
					sprite = new NativeSprite(src);
					break;				
			}
			
			return sprite;
		}		
	}
}